<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/pagejs.js"></script>

</head>
<body>


   <div class="row">
   
      <div class="col-md-12">
      
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
       <a class="navbar-brand" href="#" style="color:blue;font-size:20px;font-weight:bold">东方罗尔后台管理</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
         <li><a href="#" style="color:red;font-size:12px">欢迎张三登陆</a></li>
    
      </ul>
   
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">退出登陆</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav> 
      
      
      </div>
   
   
   
   </div>



   <div class="row">
   
    
      <div class="col-md-2">
      
           
         <%@include file="Menu.jsp" %>
           
           
      
      
      
      </div>
      
      
      
      <div class="col-md-10">
      
      
<div class="panel panel-default">
  <div class="panel-heading">员工查询</div>
  <div class="panel-body">
   
      <div class="row">
      
          <div class="col-md-12">
          
            <form class="form-horizontal" method="POST" action="QueryEmployeePageServlet?curpage=1">
            
            
            <div class="form-group">
            
 <label for="forname" class="col-md-1 control-label">姓名</label>
    
    
    
    
    <div class="col-md-3">
    
       <c:choose>
       
         <c:when test="${requestScope.name!=null }">
         
         <input type="text" class="form-control" id="forname" value="${requestScope.name}" name="name"  placeholder="请输入查询姓名">
             
         
         </c:when>
         
         <c:otherwise>
         
           <input type="text" class="form-control" id="forname"  name="name"  placeholder="请输入查询姓名">
         
         </c:otherwise>
       
       
       </c:choose>
    
    
    
    </div>
    
 <label for="forage" class="col-md-1 control-label">年龄</label>
    <div class="col-md-1">
    
       <c:choose>
       
          <c:when test="${requestScope.beginage!=null}">
          
             
            <input type="number" class="form-control" id="forage1" name="beginage" value="${requestScope.beginage}" placeholder="请输入查询的开始年龄">
          
          </c:when>
          
          <c:otherwise>
          
           <input type="number" class="form-control" id="forage1" name="beginage" placeholder="请输入查询的开始年龄">
          
          </c:otherwise>
       
       
       
       </c:choose>
    
    
    
     
    </div>
    
   <label for="forage" class="col-md-1 control-label">至</label>
    
    <div class="col-md-1">
     
        <c:choose>
        
           <c:when test="${requestScope.endage!=null}">
           
               <input type="number" class="form-control" id="forage2" name="endage" value="${requestScope.endage}" placeholder="请输入查询的结束年龄">
           
           </c:when>
           
           
           <c:otherwise>
           
            <input type="number" class="form-control" id="forage2" name="endage" placeholder="请输入查询的结束年龄">
           
           
           </c:otherwise>
        
        
        
        </c:choose>
     
     
     
     
    </div>
    <label for="forsex" class="col-md-1 control-label">性别</label>
    
     <div class="col-md-3">
     
     
       <c:choose>
       
         <c:when test="${requestScope.sex==0}">
         
            
       <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio1" value="0" checked="checked">男
</label>
<label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="1"> 女
</label>
   
   <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="2">全部
</label>
         
         
         
         </c:when>
         
         <c:when test="${requestScope.sex==1 }">
         
         
            
       <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio1" value="0" >男
</label>
<label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="1" checked="checked"> 女
</label>
   
   <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="2">全部
</label>
         
         
         </c:when>
         
         
        <c:otherwise>
        
        
           
       <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio1" value="0" >男
</label>
<label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="1"> 女
</label>
   
   <label class="radio-inline">
  <input type="radio" name="sex" id="inlineRadio2" value="2" checked="checked">全部
</label>
        
        
        </c:otherwise>
       
       
       
       
       </c:choose>
     
     

    
            
            
            </div>
            
            </div>
            
            <div class="form-group">
            
   <label for="fordepart" class="col-md-1 control-label">部门</label>
    <div class="col-md-3">
     
      <select class="form-control" id="fordepart" name="did">
      
      <option value="-1">--请选择--</option>
      
      <c:forEach items="${requestScope.dlist }" var="item">
      
      
         <c:choose>
         
           <c:when test="${item.id==requestScope.did}">
           
              <option value="${item.id}" selected="selected">${item.dname}</option>
           </c:when>
           
           
           <c:otherwise>
           
             <option value="${item.id}">${item.dname}</option>
           
           
           </c:otherwise>
         
         
         
         </c:choose>
      
      
      
      
      
      
      
      </c:forEach>
      
      
      
      </select>
     
     
    </div>
            
  <label for="foraddress" class="col-md-1 control-label">地址</label>
    <div class="col-md-3">
    
    
    <c:choose>
    
       <c:when test="${requestScope.address!=null }">
       
        <input type="text" class="form-control" id="foraddress" name="address" value="${requestScope.address }" placeholder="请输入查询地址">
       
       
       </c:when>
       
       <c:otherwise>
       
       
        <input type="text" class="form-control" id="foraddress" name="address" placeholder="请输入查询地址">
       
       
       </c:otherwise>
    
    
    
    </c:choose>
     
   
     
     
    </div> 
    
    <div class="col-md-4" style="text-align: center">
    
    <input type="submit" class="btn btn-danger" value="--查询--">
    </div>
            
            </div>
            
            
            </form>
          
          
          
          </div>
      
      
      </div>
      
      
      <div class="row">
      
         <div class="col-md-12">
         
           <table class="table table-striped">
 
                  <thead>
                  
                  	<tr><th>序号</th><th>姓名</th><th>年龄</th><th>性别</th><th>地址</th><th>工资</th><th>部门</th><th>操作</th></tr>
                  
                  
                  </thead>
                  
                  <tbody>
                  
                  
                  <c:forEach var="item" varStatus="t" items="${requestScope.list}">
                  
                     <tr>
                       <td>${item.id}</td>
                       
                       <td>${item.ename }</td>
                     
                        <td>${item.age }</td>
                        
                        <td>${item.sex }</td>
                        
                        <td>${item.address }</td>
                        
                        <td>${item.salary }</td>
                        
                        <td>${item.departname }</td>
                        
                        <td>
                        
                        
                        <form action="DeleteEmployeeServlet" method="POST">
                        
                          <input type="hidden" value="${item.id}" name="id">
                        
                          <input type="hidden" value="${requestScope.name}" name="name">
 
                          <input type="hidden" value="${requestScope.beginage}" name="beginage">
  
  
                          <input type="hidden" value="${requestScope.endage}" name="endage">
  
                          <input type="hidden" value="${requestScope.sex}" name="sex">
  
                          <input type="hidden" value="${requestScope.did}" name="did">
  
                           <input type="hidden" value="${requestScope.address}" name="address">
                            <input type="hidden" value="${requestScope.curpage}" name="curpage">
                        
                            <input type="submit" class="btn btn-danger" value="删除">
                        
                  
                        
                        
                        
                        </form>
                        
                        
                        
                        
                        <a href="ForwardUpdateXEmployeeServlet?id=${item.id}" class="btn btn-warning">更新</a></td>
                     
                     </tr>
                  
                  
                  
                  
                   </c:forEach>
                  
                  
                  </tbody>
                  
                  
                  </table>
         
         
         
         </div>
      
      
      
      
      </div>
      
      
      <div class="row">
      
         <div class="col-md-12" style="text-align: center">
 <form action="" method="POST" id="f1">
 
 <input type="hidden" value="${requestScope.name}" name="name">
 
 <input type="hidden" value="${requestScope.beginage}" name="beginage">
  
  
  <input type="hidden" value="${requestScope.endage}" name="endage">
  
  <input type="hidden" value="${requestScope.sex}" name="sex">
  
  <input type="hidden" value="${requestScope.did}" name="did">
  
  <input type="hidden" value="${requestScope.address}" name="address">
  
  <input type="hidden" value="${requestScope.curpage}" id="cp">
  <input type="hidden" value="${requestScope.counts}" id="fp">
  
  
 <nav aria-label="Page navigation">
  <ul class="pagination">
    <li id="pb">
      <a href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    
    
    <c:forEach var="t" begin="1" step="1" end="${requestScope.counts }">
    
     <c:choose>
     
        <c:when test="${t==requestScope.curpage}">
        
         <li  class="p1 active"><a href="#">${t}</a></li>
        
        
        </c:when>
        
        <c:otherwise>
        
         <li  class="p1"><a href="#">${t}</a></li>
        
        </c:otherwise>
     
     
     
     </c:choose>
    
    
    
    
    
    </c:forEach>
    
    
    
   
  
    <li id="fb">
      <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
  </form>       
         
         </div>
      
      
      
      </div>
   
   
   
   
   
  </div>
</div>
      
      
      </div>
   
   
   
   
   
   </div>




</body>
</html>